﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZCrawler
{
    [Serializable()]
    public class ZResult
    {
        private Dictionary<object, object> r;
        public ZResult()
        {
            r = new Dictionary<object, object>();
        }

        public void Set(object field,object val)
        {
            if (r.ContainsKey(field))
                r[field] = val;
            else r.Add(field, val);
        }
        public void Remove(object field)
        {
            r.Remove(field);
        }

        public object this[object field]
        {
            get
            {
                try
                {
                    return r[field];
                }
                catch(Exception e)
                {
                    return null;
                }
            }
        }

        public Dictionary<object, object> DATA
        {
            get
            {
                return r;
            }
        }
    }
}
